import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljActivityTaskForm, XhljActivityTaskQuery, XhljActivityTaskVo } from '@/api/xhlj/model/activityTaskModel';
import { request } from '@/utils/request';

// 查询活动任务列表
export function listActivityTask(query?: XhljActivityTaskQuery) {
  return request.get<TableDataInfo<XhljActivityTaskVo>>({
    url: '/xhlj/activityTask/list',
    params: query,
  });
}

// 查询活动任务详细
export function getActivityTask(taskId: number) {
  return request.get<R<XhljActivityTaskVo>>({
    url: `/xhlj/activityTask/${taskId}`,
  });
}

// 新增活动任务
export function addActivityTask(data: XhljActivityTaskForm) {
  return request.post<R<void>>({
    url: '/xhlj/activityTask',
    data,
  });
}

// 修改活动任务
export function updateActivityTask(data: XhljActivityTaskForm) {
  return request.put<R<void>>({
    url: '/xhlj/activityTask',
    data,
  });
}

// 删除活动任务
export function delActivityTask(taskIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/activityTask/${taskIds}`,
  });
}
